﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 设计模式.命令模式
{
    public class CommandPatternDemo
    {
        public static void Test()
        {
            Stock abcStock = new();

            BuyStock buyStockOrder = new(abcStock);
            SellStock sellStockOrder = new(abcStock);

            Broker broker = new();
            broker.TakeOrder(buyStockOrder);
            broker.TakeOrder(sellStockOrder);

            broker.PlaceOrders();
        }
    }
}
